<?php
namespace Core;

require_once __Dir__ . '/../../simpletest/autorun.php';

class TestOfUpdateUser extends \UnitTestCase 
{
	/**
	* Test a correct update user
	*
	* @reference
	*
	* @requirement
	* @requirement
	*/
    function testCorrectUpdateUser() 
	{
		$services = new CoreService();
		$result = $services->updateUser(USER_TEST_ID, "Christopher", "Durant", "nothing", "cdurand@gmail.com", "06.48.30.54.23", "http://jetestlesite.com", "cdurant", 3);
		
		$this->assertFalse($result->isFailed);
		$this->assertTrue(isset($result->response));
    }
	
	/**
	* Test an invalid update user by email already existing
	*
	* @reference
	*
	* @requirement
	* @requirement
	*/
    function testInvalidUpdateUserUserNotFound() 
	{
		$services = new CoreService();
		$result = $services->updateUser(-1, "Christopher", "Durant", "nothing", "cdurand@gmail.com", "06.48.30.54.23", "http://jetestlesite.com", "cdurant", 3);
		
		$this->assertTrue($result->isFailed);
    }
}
?>